using UnityEngine;
using System.Collections;

public class PlatformMover : MonoBehaviour {
	public Transform targetA;
	public Transform targetB;
	public float t = 0;
	public float speed = 0.5f;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		t = (t + .5f * Time.deltaTime);
		float cosT = Mathf.Cos(t)/2 + speed;
		
		transform.position = 
			targetA.position * (cosT)
				+ 
			targetB.position * (1-cosT);
	}
}
